
export interface NodeMetrics{
    name: string;
    time: string;
    cpuPercent: number;
    diskPercent: number;
    memoryPercent: number;
    headMemoryPercent: number;
    load1: number;
    load5: number;
    load15: number;
}

export const createNodeMetrics =(row:Record<string, any>,time: string):NodeMetrics =>{
    return {
        name: row["name"],
        time:time,
        cpuPercent: row["cpu"],
        diskPercent: row["disk.used_percent"],
        memoryPercent: row["ram.percent"],
        headMemoryPercent: row["heap.percent"],
        load1: row["load_1m"],
        load5: row["load_5m"],
        load15: row["load_15m"],
    }
}


export interface Metrics{
    label: string;
    values: Array<NodeMetrics>;
}
export interface Series{
    name: string;
    data: Array<number>
}

export interface Charts{
    title: string;
    times: Array<string>;
    series: Array<Series>;
}